<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ include file="/WEB-INF/jsp/include/taglibs.jsp"%>
<%@ page import="com.goodedeeds.webapp.controller.LoginAction"%>
<%@ page import="com.goodedeeds.webapp.controller.RegisterAction"%>
<%@ page import="com.goodedeeds.webapp.controller.ResetPasswordAction" %>
<%--@elvariable id="actionBean" type="com.goodedeeds.webapp.controller.ResetPasswordAction"--%>
<div class="quiggle-content">

    <div class="h1"> Reset Password</div>

    <div class="p-5"> Forgot your password? To reset your password, enter the email address you used when you signing up.</div>

    <c:if test="${actionBean.success != null}">
        <c:choose>
            <c:when test="${actionBean.success}">
                <div class = "p-5" id="resetPasswordDiv">
                    Your password has been successfully reset. A temporary password has been e-mailed to ${actionBean.email}
                </div>
            </c:when>
            <c:otherwise>
                <div class="p-5 error">Email (${actionBean.email}) is not valid!!!</div>
            </c:otherwise>
        </c:choose>
    </c:if>


    <div class="p-5">
        <stripes:form action="<%=ResetPasswordAction.URL%>">
            <div>
                <label>Email: &nbsp;</label><input type="email" style="width: 200px;" name="email" value="${actionBean.email}"/>
                <%--<stripes:link href="<%=LoginAction.URL%>">Login</stripes:link>--%>
                <stripes:submit name="sendPassword" value="Reset Password"/>
            </div>
        </stripes:form>
    </div>
</div>

<style>
#resetPasswordDiv{
border:1px solid #FBEED5;
background:#FCF8E3;
width:580px;
border-radius:3px;
text-align:center;
margin-top:2px;
margin-bottom:3px;
}
</style>